package com.nengchuan.eic.nceconomy.constant;

import java.util.stream.Stream;

/**
 * 功能描述:
 *
 * @Author: liurui
 * @Date: 2020/5/20 0020 上午 10:50
 */

public enum  DepartInfoEnum {

    OWNER_DEPART ("业主项目部",45),
    OWNER_DEPART1 ("业主项目部",91),
    SUPERVISOR_DEPART("监理项目部",38),
    SUPERVISOR_DEPART1("监理项目部",42),
    CONSTRUCTION_DEPART("施工项目部",27),
    CONSTRUCTION_DEPART1("施工项目部",97),
    CONSTRUCTION_DEPART2("施工项目部",33),
    OTHER("",0);

    public String text;
    public long code;

    DepartInfoEnum(String text,long code) {
        this.text = text;
        this.code = code;
    }
    public String getText() {
        return text;
    }
    public long getCode() {
        return code;
    }

    public static String getTextByCode(long code){
        return Stream.of(DepartInfoEnum.values()).filter(x->x.getCode()==code).findFirst().orElse(DepartInfoEnum.OTHER).getText();
    }

}
